import ajax from './index'

// 1.获取分类列表
export const getCategory = (parent_id, page_num, page_size) => ajax('/api/auth/category/get_category', 
{ page_num, page_size, parent_id }, 'post')

// 2.上传分类
// 1.获取分类列表
export const addCategory = (category) => ajax('/api/auth/category/add_category', category, 'post')

// 3.删除分类
export const delCategory = (id) => ajax('/api/auth/category/del_category', {id}, 'post')

// 4.编辑分类
export const editCategory = (category) => ajax('/api/auth/category/update_category', category, 'post')

// 5.根据分类id获取一条分类
export const getCategoryId = (id) => ajax('/api/auth/category/get_category_by_id', {id}, 'post')

// 6.获取所有分类
export const getCategoryWithChildren = () => ajax('api/auth/category/get_category_with_children')